package com.slipper.system.menu.bo;

import java.util.ArrayList;
import java.util.List;
import java.util.TreeSet;

import com.slipper.common.bo.CommonBO;
import org.springframework.web.multipart.MultipartFile;

/**
 * 菜单信息表
 */
public class MenuBO extends CommonBO {
    public static final String TYPE_PAGE = "页面";
    public static final String TYPE_LINk_PAGE = "挂接";
    public static final String TYPE_DASHBOARD = "大屏";

    private String id;
    private String[] ids;
    private String subsystemId;
    private String[] subsystemIds;
    private String parentId;
    private String type;
    private String vuePath;
    private String url;
    private String name;
    private String layoutPageId;
    private String pageId;
    private String pageName;
    private String defaultShow;
    private String onlyRoute;
    private String linkSource;
    private String linkUrl;
    private String linkScriptId;
    private String linkOpenMode;
    private String flowId;
    private String flowName;
    private String flowJumpId;
    private String paramJson;
    private Integer ordinal;
    private String valid;
    private Long updateTime;
    private Long createTime;

    private String subsystem;
    private String employeeId;
    private List<MenuPrivilegeBO> privilegeList = new ArrayList<>();
    private TreeSet<MenuPrivilegeBO> privileges = new TreeSet<>();
    private MultipartFile file;

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setIds(String[] ids) {
        this.ids = ids;
    }

    public String[] getIds() {
        return ids;
    }

    public String getSubsystemId() {
        return subsystemId;
    }

    public void setSubsystemId(String subsystemId) {
        this.subsystemId = subsystemId;
    }

    public String[] getSubsystemIds() {
        return subsystemIds;
    }

    public void setSubsystemIds(String[] subsystemIds) {
        this.subsystemIds = subsystemIds;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getParentId() {
        return parentId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUrl() {
        return url;
    }

    public String getVuePath() {
        return vuePath;
    }

    public void setVuePath(String vuePath) {
        this.vuePath = vuePath;
    }

    public String getDefaultShow() {
        return defaultShow;
    }

    public void setDefaultShow(String defaultShow) {
        this.defaultShow = defaultShow;
    }

    public String getOnlyRoute() {
        return onlyRoute;
    }

    public void setOnlyRoute(String onlyRoute) {
        this.onlyRoute = onlyRoute;
    }

    public String getLinkSource() {
        return linkSource;
    }

    public void setLinkSource(String linkSource) {
        this.linkSource = linkSource;
    }

    public String getLinkUrl() {
        return linkUrl;
    }

    public void setLinkUrl(String linkUrl) {
        this.linkUrl = linkUrl;
    }

    public String getLinkScriptId() {
        return linkScriptId;
    }

    public void setLinkScriptId(String linkScriptId) {
        this.linkScriptId = linkScriptId;
    }

    public String getLinkOpenMode() {
        return linkOpenMode;
    }

    public void setLinkOpenMode(String linkOpenMode) {
        this.linkOpenMode = linkOpenMode;
    }

    public String getFlowId() {
        return flowId;
    }

    public void setFlowId(String flowId) {
        this.flowId = flowId;
    }

    public String getFlowName() {
        return flowName;
    }

    public void setFlowName(String flowName) {
        this.flowName = flowName;
    }

    public String getFlowJumpId() {
        return flowJumpId;
    }

    public void setFlowJumpId(String flowJumpId) {
        this.flowJumpId = flowJumpId;
    }

    public String getParamJson() {
        return paramJson;
    }

    public void setParamJson(String paramJson) {
        this.paramJson = paramJson;
    }

    public void setOrdinal(Integer ordinal) {
        this.ordinal = ordinal;
    }

    public Integer getOrdinal() {
        return ordinal;
    }

    public void setValid(String valid) {
        this.valid = valid;
    }

    public String getValid() {
        return valid;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public String getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(String employeeId) {
        this.employeeId = employeeId;
    }

    public List<MenuPrivilegeBO> getPrivilegeList() {
        return privilegeList;
    }

    public void setPrivilegeList(List<MenuPrivilegeBO> privilegeList) {
        this.privilegeList = privilegeList;
    }

    public TreeSet<MenuPrivilegeBO> getPrivileges() {
        return privileges;
    }

    public void setPrivileges(TreeSet<MenuPrivilegeBO> privileges) {
        this.privileges = privileges;
    }

    public void addPrivilege(MenuPrivilegeBO privilege) {
        privileges.add(privilege);
    }

    public String getLayoutPageId() {
        return layoutPageId;
    }

    public void setLayoutPageId(String layoutPageId) {
        this.layoutPageId = layoutPageId;
    }

    public String getPageId() {
        return pageId;
    }

    public void setPageId(String pageId) {
        this.pageId = pageId;
    }

    public String getPageName() {
        return pageName;
    }

    public void setPageName(String pageName) {
        this.pageName = pageName;
    }

    public String getSubsystem() {
        return subsystem;
    }

    public void setSubsystem(String subsystem) {
        this.subsystem = subsystem;
    }

    public MultipartFile getFile() {
        return file;
    }

    public void setFile(MultipartFile file) {
        this.file = file;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof MenuBO menu) {
            return menu.getId().equals(this.id);
        }
        return false;
    }
}
